// File:    ContaBancaria.cs
// Author:  Lucas Bittencourt
// Created: quarta-feira, 16 de novembro de 2011 18:32:47
// Purpose: Definition of Class ContaBancaria

using System;
using System.Text;

namespace DA_OOMModel
{
   public class ContaBancaria
   {
       private int cnbIdConta;
       private string cnbTpProprietario;
       private string cnbDsConta;
       private string cnbNuConta;
      private string cnbNuDigitoConta;
      private decimal cnbVlSaldoInicial;
      private string cnbCdVariacao;
      private DateTime cnbDtAbertura;

      private Iesi.Collections.ISet lancamentoFinanceiro;
      
      /// <summary>
      /// Property for collection of LancamentoFinanceiro
      /// </summary>
      /// <pdGenerated>Default opposite class collection property</pdGenerated>
      public virtual Iesi.Collections.ISet LancamentoFinanceiro
      {
         get
         {
            return lancamentoFinanceiro;
         }
         set
         {
            this.lancamentoFinanceiro = value;         
         }
      }
      private Iesi.Collections.ISet lancamentoCancelado;
      
      /// <summary>
      /// Property for collection of LancamentoCancelado
      /// </summary>
      /// <pdGenerated>Default opposite class collection property</pdGenerated>
      public virtual Iesi.Collections.ISet LancamentoCancelado
      {
         get
         {
            return lancamentoCancelado;
         }
         set
         {
            this.lancamentoCancelado = value;         
         }
      }
      private Iesi.Collections.ISet convenio;
      
      /// <summary>
      /// Property for collection of Convenio
      /// </summary>
      /// <pdGenerated>Default opposite class collection property</pdGenerated>
      public virtual Iesi.Collections.ISet Convenio
      {
         get
         {
            return convenio;
         }
         set
         {
            this.convenio = value;         
         }
      }
      private Cliente cliente;
      
      /// <summary>
      /// Property for Cliente
      /// </summary>
      /// <pdGenerated>Default opposite class property</pdGenerated>
      public virtual Cliente Cliente
      {
         get
         {
            return cliente;
         }
         set
         {
               this.cliente = value;
         }
      }
      private Agencia agencia;
      
      /// <summary>
      /// Property for Agencia
      /// </summary>
      /// <pdGenerated>Default opposite class property</pdGenerated>
      public virtual Agencia Agencia
      {
         get
         {
            return agencia;
         }
         set
         {
               this.agencia = value;
         }
      }
      private Empresa empresa;
      
      /// <summary>
      /// Property for Empresa
      /// </summary>
      /// <pdGenerated>Default opposite class property</pdGenerated>
      public virtual Empresa Empresa
      {
         get
         {
            return empresa;
         }
         set
         {
               this.empresa = value;
         }
      }
   
      /// <summary>
      /// Get value of property CnbIdConta.
      /// </summary>
      public virtual int CnbIdConta
      {
         get
         {
            return cnbIdConta;
         }
         set
         {
            if (this.cnbIdConta != value)
               this.cnbIdConta = value;
         }
      }
      
      /// <summary>
      /// Get value of property CnbTpProprietario.
      /// </summary>
      public virtual string CnbTpProprietario
      {
         get
         {
            return cnbTpProprietario;
         }
         set
         {
            if (this.cnbTpProprietario != value)
               this.cnbTpProprietario = value;
         }
      }
      
      /// <summary>
      /// Get value of property CnbDsConta.
      /// </summary>
      public virtual string CnbDsConta
      {
         get
         {
            return cnbDsConta;
         }
         set
         {
            if (this.cnbDsConta != value)
               this.cnbDsConta = value;
         }
      }
      
      /// <summary>
      /// Get value of property CnbNuConta.
      /// </summary>
      public virtual string CnbNuConta
      {
         get
         {
            return cnbNuConta;
         }
         set
         {
            if (this.cnbNuConta != value)
               this.cnbNuConta = value;
         }
      }
      
      /// <summary>
      /// Get value of property CnbNuDigitoConta.
      /// </summary>
      public virtual string CnbNuDigitoConta
      {
         get
         {
            return cnbNuDigitoConta;
         }
         set
         {
            if (this.cnbNuDigitoConta != value)
               this.cnbNuDigitoConta = value;
         }
      }
      
      /// <summary>
      /// Get value of property CnbVlSaldoInicial.
      /// </summary>
      public virtual decimal CnbVlSaldoInicial
      {
         get
         {
            return cnbVlSaldoInicial;
         }
         set
         {
            if (this.cnbVlSaldoInicial != value)
               this.cnbVlSaldoInicial = value;
         }
      }
      
      /// <summary>
      /// Get value of property CnbCdVariacao.
      /// </summary>
      public virtual string CnbCdVariacao
      {
         get
         {
            return cnbCdVariacao;
         }
         set
         {
            if (this.cnbCdVariacao != value)
               this.cnbCdVariacao = value;
         }
      }
      
      /// <summary>
      /// Get value of property CnbDtAbertura.
      /// </summary>
      public virtual DateTime CnbDtAbertura
      {
         get
         {
            return cnbDtAbertura;
         }
         set
         {
            if (this.cnbDtAbertura != value)
               this.cnbDtAbertura = value;
         }
      }
   
      /// <summary>
      /// Get and set primary key class
      /// </summary>
      public virtual ContaBancariaPK ContaBancariaPK
      {
         get 
         {
            return new ContaBancariaPK(cnbIdConta);
         }
         set
         {
            if (value != null)
            {
               this.cnbIdConta = value.CnbIdConta;
            }
         }
      }
   
      /// <summary>
      /// Get hash code
      /// </summary>
      /// <pdGenerated>Get hash code</pdGenerated>
      public override int GetHashCode()
      {
         int _hashCode = 0;
         _hashCode = 29 * ContaBancariaPK.GetHashCode();
         if (this.cnbTpProprietario != null) 
            _hashCode += 29 * cnbTpProprietario.GetHashCode();
      
         if (this.cnbDsConta != null) 
            _hashCode += 29 * cnbDsConta.GetHashCode();
      
         if (this.cnbNuConta != null) 
            _hashCode += 29 * cnbNuConta.GetHashCode();
      
         if (this.cnbNuDigitoConta != null) 
            _hashCode += 29 * cnbNuDigitoConta.GetHashCode();
      
         _hashCode += 29 * cnbVlSaldoInicial.GetHashCode();
      
         if (this.cnbCdVariacao != null) 
            _hashCode += 29 * cnbCdVariacao.GetHashCode();
      
         _hashCode += 29 * cnbDtAbertura.GetHashCode();
         return _hashCode;
      }
   
      /// <summary>
      /// Test if two objects are equal
      /// </summary>
      /// <param name="object">Object to compare</param>
      /// <pdGenerated>Test if two objects are equal</pdGenerated>
      public override bool Equals(object obj)
      {
         if (obj == null)
            return false;
         ContaBancaria cast = obj as ContaBancaria;
         if (!(obj is ContaBancaria))
            return false;
         if (!this.ContaBancariaPK.Equals(cast.ContaBancariaPK))
            return false;
         if (this.cnbIdConta != cast.CnbIdConta)
            return false;
         if (String.Equals(this.cnbTpProprietario, cast.CnbTpProprietario) == false)
            return false;
      
         if (String.Equals(this.cnbDsConta, cast.CnbDsConta) == false)
            return false;
      
         if (String.Equals(this.cnbNuConta, cast.CnbNuConta) == false)
            return false;
      
         if (String.Equals(this.cnbNuDigitoConta, cast.CnbNuDigitoConta) == false)
            return false;
      
         if (this.cnbVlSaldoInicial != cast.CnbVlSaldoInicial)
            return false;
         if (String.Equals(this.cnbCdVariacao, cast.CnbCdVariacao) == false)
            return false;
      
         if (this.cnbDtAbertura != cast.CnbDtAbertura)
            return false;
      
         return true;
      }
   
      /// <summary>
      /// Get object in string format
      /// </summary>
      /// <pdGenerated>Get object in string format</pdGenerated>
      public override string ToString()
      {
         StringBuilder ret = new StringBuilder();
         ret.Append( "ContaBancaria: " );
         ret.Append( "CnbIdConta='" + cnbIdConta.ToString() + "'");
         if (cnbTpProprietario != null)
            ret.Append( "CnbTpProprietario='" + cnbTpProprietario.ToString() + "'");
         if (cnbDsConta != null)
            ret.Append( "CnbDsConta='" + cnbDsConta.ToString() + "'");
         if (cnbNuConta != null)
            ret.Append( "CnbNuConta='" + cnbNuConta.ToString() + "'");
         if (cnbNuDigitoConta != null)
            ret.Append( "CnbNuDigitoConta='" + cnbNuDigitoConta.ToString() + "'");
         ret.Append( "CnbVlSaldoInicial='" + cnbVlSaldoInicial.ToString() + "'");
         if (cnbCdVariacao != null)
            ret.Append( "CnbCdVariacao='" + cnbCdVariacao.ToString() + "'");
         ret.Append( "CnbDtAbertura='" + cnbDtAbertura.ToString() + "'");
         return ret.ToString();
      }
   
   }
}